// import { defineConfig } from "vite";
// import { resolve } from "path";
// import vue from "@vitejs/plugin-vue";
// import postCssPxToVw from "postcss-px-to-viewport";
// import autoprefixer from "autoprefixer";
// import Components from "unplugin-vue-components/vite";
// import { VantResolver } from "unplugin-vue-components/resolvers";
// import RankContactPlugin from "./utils/RankContactPlugin"
// import { Plugin as importToCDN } from 'vite-plugin-cdn-import'
// // import externalGlobals from 'rollup-plugin-external-globals'
// // https://vitejs.dev/config/
// export default defineConfig({
//   base: "./",
//   build: {
//     rollupOptions: {
//       input: {
//         main: resolve(__dirname, "index.html"),
//         letterCreate: resolve(__dirname, "pages/letterCreate/index.html"),
//         familyTree: resolve(__dirname, "pages/familyTree/index.html"),
//         promoCode: resolve(__dirname, "pages/promoCode/index.html"),
//         photosRank: resolve(__dirname, "pages/photosRank/index.html"),
//         productStory: resolve(__dirname, "pages/productStory/index.html"),
//         singleModel: resolve(__dirname, "pages/singleModel/index.html"),
//         //小程序条款页面-start
//         wechatPrivacy: resolve(__dirname, "pages/wechatPrivacy/index.html"),
//         pluginPrivacy: resolve(__dirname, "pages/wechatPrivacy/plugin.html"),
//         fuliPrivacy: resolve(__dirname, "pages/wechatPrivacy/fuli.html"),
//         personRight: resolve(__dirname, "pages/wechatPrivacy/personRight.html"),
//         superEasy: resolve(__dirname, "pages/wechatPrivacy/superEasy.html"),
//         superEasySmall:resolve(__dirname,'pages/wechatPrivacy/superEasySmall.html'),
//         superPersonInfo:resolve(__dirname,'pages/wechatPrivacy/superPersonInfo.html'),
//         word2html:resolve(__dirname,'pages/wechatPrivacy/word2html.html'),
//         //小程序条款页面-end
//         //app条款页面-start
//         digitalHuman: resolve(__dirname, "pages/wechatPrivacy/digital-human.html"),
//         //app条款页面-end
//         creativeAggregation: resolve(
//           __dirname,
//           "pages/creativeAggregation/index.html"
//         ),
//         yearReport: resolve(__dirname, "pages/yearReport/index.html"),
//         createrReward: resolve(__dirname, "pages/createrReward/index.html"),
//         newYearTask: resolve(__dirname, "pages/newYearTask/index.html"),
//         openkde: resolve(__dirname, "pages/openkde/index.html"),
//         policyCalc: resolve(__dirname, "pages/policyCalc/index.html"),
//         contentShow: resolve(__dirname, "pages/contentShow/index.html"),
//         retireCalc: resolve(__dirname, "pages/retireCalc/index.html"),
//         wechatJump:resolve(__dirname,'pages/wechatJump/index.html'),
//         mvpActivity:resolve(__dirname,'pages/mvpActivity/index.html'),
//         charge: resolve(__dirname, "pages/charge/index.html"),
//         pictoricalZoon: resolve(__dirname, "pages/pictoricalZoon/index.html"),
//         // 咨询记录
//         askRecord: resolve(__dirname, "pages/askRecord/index.html"),
//         // 智能陪练
//         aiTutorial: resolve(__dirname, "pages/aiTutorial/index.html"),
//         avatarTemplate: resolve(__dirname, "pages/avatarTemplate/index.html"),
//         // IP工坊
//         ipWorkshop: resolve(__dirname, "pages/ipWorkshop/index.html"),
//         // 家庭资产配置
//         familyAssets: resolve(__dirname, "pages/familyAssets/index.html"),
//       },
//       output:{
//         manualChunks:{
//           echarts:['echarts'],
//         }
//       },
//       // external:['html2canvas'],
//       plugins: [
//         //CDN引入的话，使用这个插件做配置。但是这里引入的文件要是遵循umd格式的，此项只会在打包的文件中使用，未打包状态下的dev模式中不会走这里
//         // externalGlobals({
//         // 	"html2canvas": "html2canvas",
//         // }),
//       ],
//     },
//     target:['es2015','chrome61']
//   },
//   plugins: [
//     RankContactPlugin(),
//     vue(),
//     Components({
//       resolvers: [VantResolver()],
//     }),
//     // importToCDN({
//     //   modules: [
//     //     {
//     //       // 引入时的包名 【开发环境使用本地的npm包，cdn是build时候才生效的】
//     //       name: 'esale-cordova',
//     //       // app.use(), 全局注册时分配给模块的变量
//     //       var: 'esale-cordova',
//     //       // 根据自己的版本号找到对应的CDN网址
//     //       path: 'https://salescmscdn.pa18.com/appStatic/esales-jslib/cordova/init.js',
//     //       // 根据自己的版本号找到对应的CDN网址
//     //       // css: 'https://unpkg.com/@arco-design/web-vue@2.47.1/dist/arco.css',
//     //     },
//     //     {
//     //       // 引入时的包名
//     //       name: 'trackpoint-sdk',
//     //       // app.use(), 全局注册时分配给模块的变量
//     //       var: 'trackpoint-sdk',
//     //       // 根据自己的版本号找到对应的CDN网址
//     //       path: 'https://salescmscdn.pa18.com/as/kde-common-vue/assets/js/trackpoint/trackpoint-sdk.v2.14.js',
//     //       // 根据自己的版本号找到对应的CDN网址
//     //       // css: 'https://unpkg.com/@arco-design/web-vue@2.47.1/dist/arco.css',
//     //     },
//     //   ],
//     // })
//   ],
//   resolve: {
//     alias: {
//       "@": resolve(__dirname, "src"),
//       "@public": resolve(__dirname, "public"),
//       "@utils": resolve(__dirname, "utils")
//     },
//   },
//   css: {
//     modules: { localsConvention: "camelCaseOnly" },
//     postcss: {
//       plugins: [
//         autoprefixer,
//         postCssPxToVw({
//           unitToConvert: "px",
//           viewportWidth: 375,
//           unitPrecision: 3,
//           propList: ["*"],
//           viewportUnit: "vw",
//           fontViewportUnit: "vw",
//           selectorBlackList: ["ignore-"],
//           minPixelValue: 1,
//           mediaQuery: false,
//           replace: true,
//           exclude: [/TreeChart/,/NodeAvatar/],
//           landscape: true,
//           landscapeUnit: "vh",
//           landscapeWidth: 406,
//         }),
//       ],
//     },
//   },

//   server: {
//     port: 9000, //端口号
//     strictPort: true, //是否是严格的端口号，如果true，端口号被占用的情况下，vite会退出
//     host: "0.0.0.0",
//     cors: true, //为开发服务器配置 CORS , 默认启用并允许任何源
//     https: false, //是否支持http2 如果配置成true 会打开https://localhost:3001/xxx;
//     open: true, //是否自动打开浏览器
//     proxy:{
//       '/train':{
//         target:"https://lbdp-ttt-stg1.pa18.com",
//         changeOrigin:true,
//         rewrite:(path) => path.replace(/^\/train/, "/train/callunloginapi")//重写路径,替换/api
//       }
//     }
//   },
// });
